/*
 * Copyright TLR Team, Inc. All Rights Reserved.
 */
package com.tfb.service.utility;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author james
 */
public class Utils {

    public static String getFullException(Exception e) {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw, true);
        e.printStackTrace(pw);
        return sw.toString();
    }

    public static Date getNormalizedDate() throws ParseException {
        SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
        return sd.parse(sd.format(new Date(System.currentTimeMillis())));
    }
}
